package jp.wug.samples.export;

import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.servlet.SessionScoped;

@SessionScoped
class TreeFactory {
    private final Provider<Status> statusProvider;
    private int currentId;

    @Inject
    TreeFactory(Provider<Status> statusProvider) {
        this.statusProvider = statusProvider;
        currentId = 0;
    }

    Tree create() {
        Tree tree = new Tree(this, statusProvider, currentId);
        currentId++;
        return tree;
    }
}
